﻿@model Wicresoft.SelfService.DAO.ServiceDetail
<div class="box_top ui-icons">
</div>
<div class="box_bg">
    <div class="inputarea">
        <h3>
            <i class="ui-icons"></i>流程步骤</h3>
        <div class="overFlowWrap">
            <table class="process" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <p class="process_bg1 ui-icons">
                            <span>
                                @if (@Model.account.userName.Length > 6)
                                {@Model.account.userName.Substring(0, 6)<br />}
                                else
                                {@Model.account.userName;<br />
                                }
                                <font>@Model.createTime.ToString("yyyy/MM/dd HH:mm")</font><br />
                                提交</span></p>
                    </td>
                    @if (Model.histories != null)
                    {
                        foreach (Wicresoft.SelfService.DAO.ServiceHistory h in Model.histories)
                        {
                        <td class="process_arrow ui-icons">
                        </td>
                        <td>
                            <p class="process_bg1 ui-icons">
                                <span>
                                    @if (h.approverName.Length > 6)
                                    {
                                        @h.approverName.Substring(0, 6)<br /> 
                                    }
                                    else
                                    {
                                        @h.approverName<br /> 
                                    }
                                    <font>@h.approveDate.ToString("yyyy/MM/dd HH:mm")</font><br />
                                    @h.action</span></p>
                        </td>
                               if (h.action.Trim() == "拒绝" && Model.updateTime.HasValue && DateTime.Compare(Model.updateTime.Value, h.approveDate) > 0)
                               {
                        <td class="process_arrow ui-icons">
                        </td>
                        <td>
                            <p class="process_bg1 ui-icons">
                                <span>
                                    @if (@Model.account.userName.Length > 6)
                                    {@Model.account.userName.Substring(0, 6)<br />}
                                    else
                                    {@Model.account.userName;<br />
                                    }
                                    <font>@Model.createTime.ToString("yyyy/MM/dd HH:mm")</font><br />
                                    提交</span></p>
                        </td>
                               }
                        }
                        if (Model.stauts == (int)Wicresoft.SelfService.DAO.serviceStatus.Pending || Model.stauts == (int)Wicresoft.SelfService.DAO.serviceStatus.Processing || Model.stauts == (int)Wicresoft.SelfService.DAO.serviceStatus.Waiting)
                        {

                        <td class="process_arrow ui-icons">
                        </td>
                        <td>
                            <p class="process_bg2 ui-icons">
                                <span>
                                    @if (@Model.CurrentProcessor.Length > 6)
                                    {
                                        @Model.CurrentProcessor.Substring(0, 6)<br /> 
                                    }
                                    else
                                    {
                                        @Model.CurrentProcessor<br />
                                    }
                                    <br />
                                    等待处理</span></p>
                        </td>
                        }
                        else if (Model.stauts == (int)Wicresoft.SelfService.DAO.serviceStatus.Canceled || Model.stauts == (int)Wicresoft.SelfService.DAO.serviceStatus.Done || Model.stauts == (int)Wicresoft.SelfService.DAO.serviceStatus.Rejected)
                        {
                        <td class="process_arrow ui-icons">
                        </td>
                        <td>
                            <p class="process_bg1 ui-icons">
                                <span>
                                    @if (@Model.LastProcessor.Length > 6)
                                    {
                                        @Model.LastProcessor.Substring(0, 6)<br />
                                    }
                                    else
                                    {
                                        @Model.LastProcessor<br />
                                    }
                                    @if (@Model.LastProcessTime != null)
                                    {
                                        DateTime lasttime = (DateTime)@Model.LastProcessTime;
                                        <font>@lasttime.ToString("yyyy/MM/dd HH:mm")</font>
                                    }
                                    <br />
                                    已结束</span></p>
                        </td>

                        }
                    }
                </tr>
            </table>
        </div>
    </div>
</div>
<div class="box_down ui-icons">
</div>
